import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
//导入自己的页面文件
import IndexVue from '../views/Index.vue'
import Page1 from '../views/Page1.vue'
import Page2 from '../views/Page2.vue'
import StudentView from "@/views/StudentView.vue";

//路由规则
const routes = [
  {
    path: '/',             //路径  /代表首页
    name: 'index',         //名称
    component: IndexVue,    //组件
    children:[              //子页面配置
      {
        path: '/page1',
        name: 'page1',
        component: Page1
      },
      {
        path: '/page2',
        name: 'page2',
        component: Page2
      },
      {
        path: '/student',
        name: 'student',
        component: StudentView
      },
    ]
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
